/*let updateDialog,form;
fetch("medal-update.html").then(r => r.text()).then(text => {
	updateDialog = $(text);
	$("body").append(updateDialog);

	form = updateDialog[0].querySelector("form");//form是原生标签元素，非jquery对象
	let btn = updateDialog[0].querySelector("._save");

	console.debug(updateDialog, form, btn);

	btn.onclick = function() {
		//验证输入参数
		let param = new URLSearchParams(new FormData(form));
		console.info(param.toString());
		fetch("medal-update.let", {
			method: 'POST',
			mode: 'cors',
			cache: 'no-cache',
			credentials: 'include',
			headers: {
				'Content-Type': 'application/x-www-form-urlencoded',
			},
			redirect: 'follow',
			referrerPolicy: 'no-referrer',
			body: param
		}).then(r => r.json()).then(data => {
			if (data.ok) {
				updateDialog.modal('hide');
				window.postMessage("loadData");//发送消息
			} else {
				alert(data.msg);
			}
			console.debug(data);
		}).catch(e => {
			console.error(e);
		});
	}
});

export default function(item) {
	updateDialog.modal('show');
	for(let name in item){
		form[name].value=item[name];
	}
}*/